function e(e, t, n) {
    return t in e ? Object.defineProperty(e, t, {
        value: n,
        enumerable: !0,
        configurable: !0,
        writable: !0
    }) : e[t] = n, e;
}

Object.defineProperty(exports, "__esModule", {
    value: !0
});

var t = function(e) {
    return e && e.__esModule ? e : {
        default: e
    };
}(require("../component"));

exports.default = {
    setDefaults: function() {
        return {
            title: "请选择",
            cols: [],
            value: [],
            toolbar: !0,
            toolbarCloseText: "完成",
            onChange: function() {}
        };
    },
    temp: {},
    init: function(n) {
        var i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, a = this, u = function() {
            for (var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [], n = [], i = [], a = [], u = 0; u < e.length; u++) if (e[u]) {
                var o = e[u].values || [], l = e[u].displayValues || [], s = t[u];
                i.push(void 0 !== o[s] ? s : 0), n.push(void 0 !== o[s] ? o[s] : o[0]), a.push(void 0 !== l[s] ? l[s] : void 0);
            }
            return !(n.indexOf(void 0) >= 0) && {
                value: n,
                valueIndex: i,
                displayValue: a
            };
        }, o = Object.assign({}, this.setDefaults(), i);
        o.value = u(o.cols, o.value).valueIndex;
        var l = new t.default({
            scope: "$wux.picker." + n,
            data: o,
            methods: {
                hide: function(e) {
                    this.setHidden([ "weui-animate-slide-down", "weui-animate-fade-out" ]);
                },
                show: function() {
                    this.setVisible([ "weui-animate-slide-up", "weui-animate-fade-in" ]);
                },
                bindChange: function(e) {
                    this.render(e.detail.value);
                },
                updateValue: u,
                render: function() {
                    var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], i = this.getComponentData().cols, u = this.updateValue(i, t);
                    a.temp[n] = t, this.setData(e({}, "$wux.picker." + n + ".value", u.valueIndex)), 
                    "function" == typeof o.onChange && o.onChange(u);
                }
            }
        });
        l.show(), l.render(a.temp[n] || o.value);
    }
};